const schemas = {
  "addPlan": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          }
        },
        "required": [
          "optResult"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "getPlans": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          },
          "totalDataCount": {
            "type": "number",
            "description": "总记录数"
          },
          "plans": {
            "description": "基础信息方案列表",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number",
                  "description": "方案ID"
                },
                "name": {
                  "type": "string",
                  "description": "方案名称"
                },
                "type": {
                  "type": "string",
                  "description": "测试类型，可取值：\napi - API测试\nui - UI测试\nperformance - 性能测试"
                },
                "caseNumber": {
                  "type": "string",
                  "description": "用例数量"
                },
                "creatorName": {
                  "type": "string",
                  "description": "创建者名称"
                },
                "createTime": {
                  "type": "string",
                  "description": "创建时间"
                }
              },
              "required": [
                "id",
                "name",
                "type",
                "caseNumber",
                "creatorName",
                "createTime"
              ]
            }
          }
        },
        "required": [
          "optResult",
          "totalDataCount",
          "plans"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "getPlanDetail": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          },
          "planId": {
            "type": "number",
            "description": "方案ID "
          },
          "name": {
            "type": "string",
            "description": "方案名称"
          },
          "type": {
            "type": "string",
            "description": "测试类型，可取值：\napi - API测试\nui - UI测试\nperformance - 性能测试"
          },
          "caseNumber": {
            "type": "string",
            "description": "用例数量"
          },
          "creatorName": {
            "type": "string",
            "description": "创建者名称"
          },
          "createTime": {
            "type": "string",
            "description": "创建时间"
          },
          "status": {
            "type": "number",
            "description": "是否允许执行，可取值：\n0-否\n1-是"
          },
          "description": {
            "type": "string",
            "description": "方案描述"
          },
          "targetConfig": {
            "type": "array",
            "description": "目标配置\nConfig数据结构见“获取方案信息”",
            "items": {
              "title": "config",
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "配置项名称"
                },
                "value": {
                  "type": "string",
                  "description": "配置项值"
                },
                "description": {
                  "type": "string",
                  "description": "描述"
                }
              },
              "required": [
                "name",
                "value",
                "description"
              ]
            }
          },
          "envConfig": {
            "type": "array",
            "description": "环境配置",
            "items": {
              "title": "config",
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "配置项名称"
                },
                "value": {
                  "type": "string",
                  "description": "配置项值"
                },
                "description": {
                  "type": "string",
                  "description": "描述"
                }
              },
              "required": [
                "name",
                "value",
                "description"
              ]
            }
          },
          "stressConfig": {
            "type": "array",
            "description": "压力配置",
            "items": {
              "title": "config",
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "配置项名称"
                },
                "value": {
                  "type": "string",
                  "description": "配置项值"
                },
                "description": {
                  "type": "string",
                  "description": "描述"
                }
              },
              "required": [
                "name",
                "value",
                "description"
              ]
            }
          },
          "selfConfig": {
            "type": "array",
            "description": "自定义配置",
            "items": {
              "title": "config",
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "配置项名称"
                },
                "value": {
                  "type": "string",
                  "description": "配置项值"
                },
                "description": {
                  "type": "string",
                  "description": "描述"
                }
              },
              "required": [
                "name",
                "value",
                "description"
              ]
            }
          },
          "cases": {
            "type": "array",
            "description": "用例树信息，包含与当前方案关系",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number",
                  "description": "需求/用例ID"
                },
                "name": {
                  "type": "string",
                  "description": "需求/用例名称"
                },
                "type": {
                  "type": "number",
                  "description": "结点类型，可取值：\n1-需求项，2-用例项，3-无需求项"
                },
                "case": {
                  "description": "用例信息， 仅当type=2时有值",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "planCaseId": {
                        "type": "number",
                        "description": "方案内用例的特定ID"
                      },
                      "status": {
                        "type": "number",
                        "description": "是否可用，可取值：\n0-否\n1-是"
                      },
                      "dataSum": {
                        "type": "number",
                        "description": "用例包含的数据集条数"
                      },
                      "evaluateMethod": {
                        "type": "string",
                        "description": "测试结果评价策略，可取值：\nallsuccess - 全部成功才成功\nonesuccess - 成功一条就成功\nsuccessrate - 成功率"
                      },
                      "successRate": {
                        "type": "number",
                        "description": "成功率，当evaluateMethod=successrate时此项有值"
                      }
                    },
                    "required": [
                      "planCaseId",
                      "status",
                      "dataSum",
                      "evaluateMethod"
                    ]
                  }
                },
                "children": {
                  "type": "array",
                  "description": "子节点列表，当type=1或3时有值",
                  "items": {
                    "type": "object"
                  }
                }
              },
              "required": [
                "id",
                "name",
                "type"
              ]
            }
          },
          "runners": {
            "type": "array",
            "description": "有运行权限的用户信息，包含与当前方案关系",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number",
                  "description": "用户ID"
                },
                "name": {
                  "type": "string",
                  "description": "用户名称"
                }
              },
              "required": [
                "id",
                "name"
              ]
            }
          }
        },
        "required": [
          "optResult",
          "planId",
          "name",
          "type",
          "caseNumber",
          "creatorName",
          "createTime",
          "status",
          "description",
          "targetConfig",
          "envConfig",
          "cases",
          "runners"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "forbidPlan": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          }
        },
        "required": [
          "optResult"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "changePlanConfig": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          }
        },
        "required": [
          "optResult"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "changePlanDescription": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          }
        },
        "required": [
          "optResult"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "deletePlan": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          }
        },
        "required": [
          "optResult"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "getRunners": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          },
          "runners": {
            "description": "运行人员列表",
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number",
                  "description": "用户ID"
                },
                "name": {
                  "type": "string",
                  "description": "用户名称"
                },
                "inPlan": {
                  "type": "number",
                  "description": "用户是否已被授权运行当前方案，可取值：0-否，1-是"
                }
              },
              "required": [
                "id",
                "name"
              ]
            }
          }
        },
        "required": [
          "optResult",
          "runners"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "saveRunners": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          }
        },
        "required": [
          "optResult"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "addCasesInPlan": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          }
        },
        "required": [
          "optResult"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  },
  "changeCasePolicy": {
    "responses": {
      "200": {
        "type": "object",
        "properties": {
          "optResult": {
            "type": "number",
            "description": "值为0，操作成功"
          },
          "msg": {
            "type": "string",
            "description": "操作失败说明"
          }
        },
        "required": [
          "optResult"
        ],
        "$schema": "http://json-schema.org/draft-04/schema#"
      }
    }
  }
}

export default schemas;
